<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="app" uri="/application" %>
<%@ taglib  prefix="s"  uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>站点管理_添加站点</title>
<link href="/css/role.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- title -->
<div class="right_title">
  <div class="h">系统模块->添加菜单</div>
</div>
<!-- title end -->
<div class="zdgl">

 <form action="/role/su_menu.shtml" name="conts" onsubmit="return validate.getSubmit()();">
  <input name="id" value="${menu.id}" type="hidden" />
  <input name="pid" value="${pid}" type="hidden" />
	<div class="line">
	    <div class="td_left">菜单名称：</div>
	    <div>
	      <input type="text" name="name" value="${menu.menuName}" maxlength="20" class="w_180" />
	    </div>
	  </div>

  <div class="line clear">
    <div class="td_left">菜单链接：</div>
    <div>
      <input type="text" name="href" value="${menu.menuHref}" class="w_180" maxlength="120" />
    </div>
  </div>
  <div class="line clear">
    <div class="td_left">排序：</div>
    <div>
      <input type="text" onkeypress="util.justNum();" name="seq" size="5" value="${menu.menuSeq}" maxlength="5" />
    </div>
  </div>
   <div class="line clear">
    <div class="td_left">是否显示：</div>
    <div>
         是<input  type="radio" name="visitility" value="1" <c:if test="${menu.visitility!='0'}">checked="checked"</c:if> /> 否<input  type="radio" <c:if test="${menu.visitility=='0'}"> checked="checked"</c:if> name="visitility" value="0" />
    </div>
  </div>
   <div class="sub clear"><input type="submit" name="sm" value="确定"> </div>
   </form>

</div>
</body>
</html>
<script type="text/javascript" src="/scripts/util.js"></script>	
<script type="text/javascript" src="/scripts/form_validate.js"></script>
<script type="text/javascript">

    validate.addvalidte(document.conts,{
        rules:{
           name:{checkNull:true},
           href:{checkNull:true}
           },
	    message:{
	       name:{checkNull:"必填项!"},
	       href:{checkNull:"请输入菜单链接！"}
	    },
	    errorPlacement:function(e,m){
	       ep(e,m);
	    },
	    success:function(e){
	        suc(e);
	    }
	    });
	
	    
	    
	function ep(e,m){
	   var tag = e.getAttribute('warn');
	       if(tag!='true'){
	         e.setAttribute('warn','true');
	         var div = util.cElem('label',{className:'error',cssText:'',id:e.name+'_error'},m);
	         insertAfter(div,e);
	       }
	}
	
	function suc(e){
	    var o = util.$(e.name+'_error');
		o && o.parentNode && (o.parentNode.removeChild(o));
		e.setAttribute('warn','false');
	}
	    
	function _submit(th){
      	if(validate.getSubmit()() ){
	       document.conts.submit();
	       th.disabled = "disabled";
	    }
	}
	
	
</script>

